package chapter9.section1;

import java.util.Objects;
/**
 * 程序9-4：实现获取对象的哈希值
 */
public class TestHash {
    public static void main(String[] args) {
        int hashCode1 = Objects.hashCode("hello");
        int hash1 = Objects.hash("hello");
        int hash2 = Objects.hash("hello", "hash");
        System.out.println("hashCode1=" + hashCode1);
        System.out.println("hash1=" + hash1);
        System.out.println("hash2=" + hash2);
    }
}
